home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club - Holiday 1996
/
Software of the Month Club - Holiday 1996.iso
/
pc
/
win
/
fgx
/
game_3.sx_
/
game_3.sx
Wrap
Text File
|
1996-06-30
|
683b
|
31 lines
//////////////////////////
// Harrow Software 1996
// Colored ball definition
//
message "Please execute game_1.sxt"
return
initialize: my_sprite, my_bitmaps
// choose a random color
random_color = floor (rnd 3)
my_bitmap = my_bitmaps get random_color
$my_sprite.name = "colored ball"
xpos = 0
ypos = 0
xvel = rnd 20 - 10 // random velocity
yvel = rnd 20 - 10
update_sprite:
xmid = my_bitmap.xlen/2 // get offset from center
ymid = my_bitmap.ylen/2
sprite my_sprite bitmap my_bitmap at xpos-xmid, ypos-ymid depth ypos
xpos = xpos + xvel // move the ball
ypos = ypos + yvel
// wrap the ball around the window
wrap xpos,ypos window